using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using Layout;

namespace CSDesktopUsiXMLRenderer
{
    class UsiXMLInputTextRenderer : UsiXMLElementRenderer
    {

        public UsiXMLInputTextRenderer()
        {
           
        }

        public override String getValidElementName(){
            return "inputText";
        }

        public override Control processRenderization(XmlNode element)
        {
            XmlElement elm = (XmlElement) element;
            String name = elm.GetAttribute("name");
            String isEnabled = elm.GetAttribute("isEnabled");
            String isVisible = elm.GetAttribute("isVisible");
            String isEditable = elm.GetAttribute("isEditable");

            ElementsParser parser = new ElementsParser();

            TextBox textBox = new TextBox();
            textBox.Name = name;
            textBox.Enabled = parser.parseBoolean(isEnabled);
            textBox.Visible = parser.parseBoolean(isVisible);
            textBox.Width = 160;
            
            return textBox;
        }

        public override UsiXMLElementRenderer getNextRenderer()
        {
            return null;
        }
    }
}
